.class public abstract Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;
.super Landroid/app/Activity;
.source "AbstractViewPagerActivity.java"


# static fields
.field protected static ADAPTER:Landroid/support/v4/view/PagerAdapter;

.field public static final DEBUG:Z

.field private static final TAG:Ljava/lang/String;


# instance fields
.field private context:Landroid/content/Context;

.field protected dbManager:Lcom/opongo/blogapp/manager/DatabaseManager;

.field protected lockLoading:Z

.field protected mAdapter:Lcom/opongo/blogapp/adapter/PostListAdapter;

.field protected parcelable:Landroid/os/Parcelable;

.field protected position:I

.field protected post_id:I

.field protected query:Ljava/lang/String;

.field protected queryLimit:I


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 24
    sget-boolean v0, Lcom/opongo/blogapp/AbaSettings;->DEBUG:Z

    sput-boolean v0, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;->DEBUG:Z

    .line 25
    const-class v0, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;

    .line 26
    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    .line 25
    sput-object v0, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;->TAG:Ljava/lang/String;

    .line 21
    return-void
.end method

.method public constructor <init>()V
    .locals 2

    .prologue
    const/4 v1, 0x0

    .line 21
    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    .line 33
    const/16 v0, 0x14

    iput v0, p0, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;->queryLimit:I

    .line 35
    iput v1, p0, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;->post_id:I

    .line 36
    iput v1, p0, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;->position:I

    .line 38
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;->context:Landroid/content/Context;

    .line 21
    return-void
.end method

.method private openBookmarks()V
    .locals 2

    .prologue
    .line 61
    new-instance v0, Landroid/content/Intent;

    const-class v1, Lcom/opongo/blogapp/activities/BookmarksListActivity;

    invoke-direct {v0, p0, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 62
    .local v0, intent:Landroid/content/Intent;
    invoke-virtual {p0, v0}, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;->startActivity(Landroid/content/Intent;)V

    .line 63
    return-void
.end method

.method private openCategories()V
    .locals 2

    .prologue
    .line 66
    new-instance v0, Landroid/content/Intent;

    const-class v1, Lcom/opongo/blogapp/activities/CategoryListActivity;

    invoke-direct {v0, p0, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 67
    .local v0, intent:Landroid/content/Intent;
    invoke-virtual {p0, v0}, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;->startActivity(Landroid/content/Intent;)V

    .line 68
    return-void
.end method

.method private openOptions()V
    .locals 3

    .prologue
    .line 55
    new-instance v0, Landroid/content/Intent;

    invoke-virtual {p0}, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;->getBaseContext()Landroid/content/Context;

    move-result-object v1

    .line 56
    const-class v2, Lcom/opongo/blogapp/activities/AppPreferenceActivity;

    .line 55
    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 57
    .local v0, settingsActivity:Landroid/content/Intent;
    invoke-virtual {p0, v0}, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;->startActivity(Landroid/content/Intent;)V

    .line 58
    return-void
.end method

.method private openVoting()V
    .locals 3

    .prologue
    .line 71
    new-instance v0, Landroid/content/Intent;

    const-string v1, "android.intent.action.VIEW"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 72
    .local v0, intent:Landroid/content/Intent;
    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "market://details?id="

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0}, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;->getPackageName()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;

    .line 73
    invoke-virtual {p0, v0}, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;->startActivity(Landroid/content/Intent;)V

    .line 74
    return-void
.end method


# virtual methods
.method public onCreate(Landroid/os/Bundle;)V
    .locals 0
    .parameter "savedInstanceState"

    .prologue
    .line 45
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 46
    return-void
.end method

.method public onCreateOptionsMenu(Landroid/view/Menu;)Z
    .locals 2
    .parameter "menu"

    .prologue
    .line 50
    invoke-virtual {p0}, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;->getMenuInflater()Landroid/view/MenuInflater;

    move-result-object v0

    const v1, 0x7f0e0003

    invoke-virtual {v0, v1, p1}, Landroid/view/MenuInflater;->inflate(ILandroid/view/Menu;)V

    .line 51
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreateOptionsMenu(Landroid/view/Menu;)Z

    move-result v0

    return v0
.end method

.method public onOptionsItemSelected(Landroid/view/MenuItem;)Z
    .locals 3
    .parameter "item"

    .prologue
    const/4 v0, 0x1

    .line 109
    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v1

    const v2, 0x7f080062

    if-ne v1, v2, :cond_1

    .line 110
    invoke-direct {p0}, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;->openOptions()V

    .line 125
    :cond_0
    :goto_0
    return v0

    .line 112
    :cond_1
    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v1

    const v2, 0x7f080060

    if-eq v1, v2, :cond_0

    .line 115
    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v1

    const v2, 0x7f080061

    if-ne v1, v2, :cond_2

    .line 116
    invoke-direct {p0}, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;->openBookmarks()V

    goto :goto_0

    .line 118
    :cond_2
    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v1

    const v2, 0x7f080063

    if-ne v1, v2, :cond_3

    .line 119
    invoke-direct {p0}, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;->openCategories()V

    goto :goto_0

    .line 121
    :cond_3
    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v1

    const v2, 0x7f080064

    if-ne v1, v2, :cond_4

    .line 122
    invoke-direct {p0}, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;->openVoting()V

    goto :goto_0

    .line 125
    :cond_4
    invoke-super {p0, p1}, Landroid/app/Activity;->onOptionsItemSelected(Landroid/view/MenuItem;)Z

    move-result v0

    goto :goto_0
.end method

.method protected onPause()V
    .locals 1

    .prologue
    .line 88
    invoke-super {p0}, Landroid/app/Activity;->onPause()V

    .line 90
    sget-object v0, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;->ADAPTER:Landroid/support/v4/view/PagerAdapter;

    invoke-virtual {v0}, Landroid/support/v4/view/PagerAdapter;->saveState()Landroid/os/Parcelable;

    move-result-object v0

    iput-object v0, p0, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;->parcelable:Landroid/os/Parcelable;

    .line 91
    return-void
.end method

.method protected onResume()V
    .locals 3

    .prologue
    .line 96
    invoke-super {p0}, Landroid/app/Activity;->onResume()V

    .line 98
    sget-object v0, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;->ADAPTER:Landroid/support/v4/view/PagerAdapter;

    iget-object v1, p0, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;->parcelable:Landroid/os/Parcelable;

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/support/v4/view/PagerAdapter;->restoreState(Landroid/os/Parcelable;Ljava/lang/ClassLoader;)V

    .line 99
    return-void
.end method

.method public onSearchRequested()Z
    .locals 2

    .prologue
    const/4 v1, 0x0

    const/4 v0, 0x0

    .line 103
    invoke-virtual {p0, v1, v0, v1, v0}, Lcom/opongo/blogapp/activities/AbstractViewPagerActivity;->startSearch(Ljava/lang/String;ZLandroid/os/Bundle;Z)V

    .line 104
    const/4 v0, 0x1

    return v0
.end method

.method protected onStart()V
    .locals 0

    .prologue
    .line 78
    invoke-super {p0}, Landroid/app/Activity;->onStart()V

    .line 79
    return-void
.end method

.method protected superOnStart()V
    .locals 0

    .prologue
    .line 82
    invoke-super {p0}, Landroid/app/Activity;->onStart()V

    .line 83
    return-void
.end method
